﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.Reporting.WinForms;

namespace MNNUTEM
{
    public partial class Reportes : Form
    {
        public Reportes()
        {
            InitializeComponent();
        }

        private void Reportes_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'DataSet1.vProductoSucursal' table. You can move, or remove it, as needed.
            this.vProductoSucursalTableAdapter.Fill(this.DataSet1.vProductoSucursal);
            // TODO: This line of code loads data into the 'DataSet1.prueba2' table. You can move, or remove it, as needed.
            this.prueba2TableAdapter.Fill(this.DataSet1.prueba2);
            // TODO: This line of code loads data into the 'DataSet1.prueba1' table. You can move, or remove it, as needed.
            this.prueba1TableAdapter.Fill(this.DataSet1.prueba1);
            // TODO: This line of code loads data into the 'myonatur_utemDataSet.Usuario' table. You can move, or remove it, as needed.
            this.UsuarioTableAdapter.Fill(this.myonatur_utemDataSet.Usuario);
           
            this.reportViewer1.RefreshReport();
            this.reportViewer2.RefreshReport();
            this.reportViewer1.RefreshReport();
        }

        private void button4_Click(object sender, EventArgs e)
        {
          /*  DataSet1TableAdapters.prueba1TableAdapter adapter = new DataSet1TableAdapters.prueba1TableAdapter();
            DataSet1.prueba1DataTable table = new DataSet1.prueba1DataTable();
            adapter.FillBy(table, int.Parse(textBox1.Text));

            ReportDataSource MyNewDataSource= new ReportDataSource("InventarioSet", (DataTable)table);
            this.reportViewer2.LocalReport.DataSources.Clear();
            this.reportViewer2.LocalReport.DataSources.Add(MyNewDataSource);
            this.reportViewer2.LocalReport.Refresh();
            this.reportViewer2.RefreshReport();
            */

        }

        private void button1_Click(object sender, EventArgs e)
        {
            DataSet1TableAdapters.prueba1TableAdapter adapter1 = new DataSet1TableAdapters.prueba1TableAdapter();
            DataSet1.prueba1DataTable table1 = new DataSet1.prueba1DataTable();
            adapter1.FillBy1(table1, textBox2.Text);
            ReportDataSource MyNewDataSource1 = new ReportDataSource("InventarioSet1", (DataTable)table1);
            this.reportViewer2.LocalReport.DataSources.Clear();
            this.reportViewer2.LocalReport.DataSources.Add(MyNewDataSource1);
            this.reportViewer2.LocalReport.Refresh();
            this.reportViewer2.RefreshReport();
        }

        private void button4_Click_1(object sender, EventArgs e)
        {
            DataSet1TableAdapters.prueba1TableAdapter adapter = new DataSet1TableAdapters.prueba1TableAdapter();
            DataSet1.prueba1DataTable table = new DataSet1.prueba1DataTable();
            adapter.FillBy(table, int.Parse(textBox1.Text));

            ReportDataSource MyNewDataSource = new ReportDataSource("InventarioSet1", (DataTable)table);
            this.reportViewer2.LocalReport.DataSources.Clear();
            this.reportViewer2.LocalReport.DataSources.Add(MyNewDataSource);
            this.reportViewer2.LocalReport.Refresh();
            this.reportViewer2.RefreshReport();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            DataSet1TableAdapters.prueba1TableAdapter adapter3 = new DataSet1TableAdapters.prueba1TableAdapter();
            DataSet1.prueba1DataTable table3 = new DataSet1.prueba1DataTable();
            adapter3.FillBy2(table3, int.Parse(textBox3.Text));

            ReportDataSource MyNewDataSource = new ReportDataSource("InventarioSet1", (DataTable)table3);
            this.reportViewer2.LocalReport.DataSources.Clear();
            this.reportViewer2.LocalReport.DataSources.Add(MyNewDataSource);
            this.reportViewer2.LocalReport.Refresh();
            this.reportViewer2.RefreshReport();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            DataSet1TableAdapters.vProductoSucursalTableAdapter adapter3 = new DataSet1TableAdapters.vProductoSucursalTableAdapter();
            DataSet1.vProductoSucursalDataTable table3 = new DataSet1.vProductoSucursalDataTable();
            adapter3.FillBy(table3,int.Parse(textBox4.Text));

            ReportDataSource MyNewDataSource = new ReportDataSource("Sucursal", (DataTable)table3);
            this.reportViewer1.LocalReport.DataSources.Clear();
            this.reportViewer1.LocalReport.DataSources.Add(MyNewDataSource);
            this.reportViewer1.LocalReport.Refresh();
            this.reportViewer1.RefreshReport();
        }

        private void button5_Click(object sender, EventArgs e)
        {
            DataSet1TableAdapters.prueba3TableAdapter adapter3 = new DataSet1TableAdapters.prueba3TableAdapter();
            DataSet1.prueba3DataTable table3 = new DataSet1.prueba3DataTable();
            adapter3.FillBy(table3, int.Parse(textBox5.Text));

            ReportDataSource MyNewDataSource = new ReportDataSource("InventarioSet1", (DataTable)table3);
            this.reportViewer2.LocalReport.DataSources.Clear();
            this.reportViewer2.LocalReport.DataSources.Add(MyNewDataSource);
            this.reportViewer2.LocalReport.Refresh();
            this.reportViewer2.RefreshReport();
           
        }
    }
}
